<template>
  <div class="app">
    <van-nav-bar
      title="退款详情"
      left-text=""
      left-arrow
      @click="backlink()"
    ></van-nav-bar>
    <div class="refundcontainer">
      <div class="goodscard">
        <div class="refundstatus" v-if="refundinfo.status == 0">退款成功</div>
        <div class="refundstatus" v-if="refundinfo.status == 1">退款失败</div>
        <div class="refundtime">{{ refundinfo.tuikuantime }}</div>
        <div class="goodsinfo">
          <div class="goodsimg">
            <img :src="refundinfo.goodsimg" alt="" />
          </div>
          <div class="info">
            <div class="goodsname">{{ refundinfo.goodsname }}</div>
            <div class="price">退款:￥{{ refundinfo.price }}</div>
          </div>
        </div>
        <div class="line1">
          <div style="font-size: 18px">退回支付宝</div>
          <div style="font-size: 18px; color: orange">
            ￥{{ refundinfo.price }}
          </div>
        </div>
      </div>
      <div class="refundcard">
        <div style="font-size: 20px;margin-bottom: 10px;">退款信息</div>
        <div class="info1">
          <div>退款编号</div>
          <div>{{ refundinfo.refund_id }}</div>
        </div>
        <div class="info1">
          <div>退款原因</div>
          <div>{{ refundinfo.refundreason }}</div>
        </div>
        <div class="info1">
          <div>退款金额</div>
          <div>￥{{ refundinfo.price }}</div>
        </div>
        <div class="info1">
          <div>申请时间</div>
          <div>{{ refundinfo.applytime }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      refundinfo: {},
    };
  },
  methods:{
    backlink() {
      this.$router.back();
    },
  },
  created() {
    this.refundinfo = JSON.parse(this.$route.params.refundinfo);
  },
};
</script>

<style scoped>
.app {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: #f2f3f5;
}
.refundcontainer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.goodscard {
  width: 100%;
  background-color: white;
  border-radius: 15px;
  box-sizing: border-box;
  padding: 15px;
  margin-top: 10px;
}
.refundstatus {
  font-size: 18px;
}
.refundtime {
  font-size: 14px;
  color: gray;
  margin-top: 3px;
}
.goodsinfo {
  display: flex;
  height: 80px;
  box-sizing: border-box;
  padding: 10px;
  background-color: #f2f3f5;
  margin-top: 5px;
  border-radius: 10px;
}
.goodsimg {
  width: 60px;
  height: 60px;
  border-radius: 5px;
  overflow: hidden;
}
.goodsimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-left: 5px;
}
.goodsname {
  font-size: 18px;
}
.price {
  font-size: 18px;
}
.line1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.refundcard {
  width: 100%;
  background-color: white;
  border-radius: 15px;
  box-sizing: border-box;
  padding: 15px;
  margin-top: 10px;
}
.info1 {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  align-items: flex-end;
  margin: 5px auto;
}
</style>